home *** CD-ROM | disk | FTP | other *** search
/ Computer Select (Limited Edition) / Computer Select.iso / dobbs / v17n03 / oopasm.exe / HORZMENU.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-07-16  |  1.2 KB  |  64 lines

  1.     .MODEL    SMALL
  2.  
  3.     INCLUDE    equates.inc
  4.     INCLUDE    instance.inc
  5.     INCLUDE    messages.inc
  6.     INCLUDE    objects.inc
  7.  
  8. IF1
  9.     INCLUDE    macros.mac
  10.     INCLUDE    objects.mac
  11.     INCLUDE    cursor.mac
  12. ENDIF
  13.  
  14.     EXTRN    menuInstVars:NEAR
  15.     EXTRN    prtString_:NEAR
  16.  
  17.     EXTRN    Dispatch:WORD
  18.     EXTRN    Menu:WORD
  19.     EXTRN    Window:WORD
  20.  
  21.  
  22.     .CODE
  23.  
  24. COMMENT    %
  25. ==============================================================================
  26. Displays a horizontal menu.
  27.  
  28. Passed:    bl - Color
  29.     dx - Menu row/column
  30.     si - Pointer to menu table
  31.  
  32. =============================================================================%
  33. disHorzMenu    PROC    NEAR
  34.     call        menuInstVars
  35.     setCur        dh,dl            ;Position cursor
  36.     mov        di,si
  37. dhm1:    cursorRight    ColOffset        ;Space between menu items
  38.     mov        Wptr[di],dx        ;Save row/column
  39.     add        di,2            ;Point to menu item ptr
  40.     mov        si,Wptr[di]        ;Pass string addr
  41.     call        prtString_        ;Display the string
  42.     add        di,2            ;Point to next item's row/col
  43.     identity    Wptr[di],dhm1        ;Not nil? - Loop
  44.     ret
  45. disHorzMenu    ENDP
  46.  
  47.  
  48.  
  49.     .DATA
  50.  
  51. defMsg    HorzMenu,\
  52.     Refresh,\
  53.     <,,disHorzMenu>
  54.  
  55. defObj    HorzMenu,\
  56.     <Window,Menu,Dispatch>,\
  57.     <>,\
  58.     <Refresh,Read,Next,Prev,Select,Clear>
  59.  
  60.  
  61.  
  62.     END
  63. 
  64.